package org.geektimes.rest.demo;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;

public class RestClientDemo {
    public static void main(String[] args) {
        Client client = ClientBuilder.newClient();
        // get request
//        Response response = client.target("http://localhost:8080/showConfig").request().get();



        // post request
        Entity entity = Entity.json("{'a':'1'}");
        Response response = client.target("http://localhost:8080/showConfig").request().post(entity);


        String s = response.readEntity(String.class);
        System.out.println("s = " + s);
    }
}
